package se3a04.mcmapster;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class displayHuntInfo extends Activity{
		
	Button yes, no;
	TextView name, date, time, timelimit;
	String[] huntParams;
	
	@Override
	protected void onCreate(Bundle displayHuntInfoState) {

		super.onCreate(displayHuntInfoState);
		setContentView(R.layout.huntinfo);
	
		yes = (Button) findViewById(R.id.bYes);
		no = (Button) findViewById(R.id.bNo);
	
		name = (TextView) findViewById(R.id.tvHuntName);
		date = (TextView) findViewById(R.id.tvHuntDate);
		time = (TextView) findViewById(R.id.tvHuntTime);
		timelimit = (TextView) findViewById(R.id.tvHuntTimeLimit);
		
		getHuntInfo(huntRegistration.huntName);
	
		name.setText("Name: "+huntParams[0]);
		date.setText("Date: "+huntParams[1]);
		time.setText("Time: "+huntParams[2]);
		timelimit.setText("Time Limit: "+huntParams[3]);
		
		yes.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				
				huntRegistration.registeredList.add(huntParams[0]);
				Intent startHuntController = new Intent("se3a04.mcmapster.HUNTCONTROLLER");
				startActivity(startHuntController);
			}
		});
		
		no.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				
				finish();
			}
		});
	}
	
	public void getHuntInfo(String huntName) {
		
		String tempHunt = "Test Hunt 1;December 10th, 2011;6 pm;2 hours;";
		//String tempHunt = LocalDB.getHuntInfo(huntName);
		huntParams = tempHunt.split(";");
	}
}
